package com.palmplaystore.bigdata;

import java.io.IOException;

import org.apache.storm.generated.AlreadyAliveException;
import org.apache.storm.generated.AuthorizationException;
import org.apache.storm.generated.InvalidTopologyException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.palmplaystore.bigdata.storm.appupdate.AppUpdateTopo;

public class MainApplication {
    
    private static final Logger logger = LoggerFactory.getLogger(MainApplication.class);
    
	public static void main(String[] args) throws AuthorizationException, AlreadyAliveException, InvalidTopologyException, IOException {
		logger.warn("Stream processer starting...");
		final ApplicationContext  ctx = new ClassPathXmlApplicationContext("classpath*:spring.xml");
        logger.warn("加载spring容器");
        ContextHolder.initApplicationContext(ctx);
        AppUpdateTopo apt= ctx.getBean(AppUpdateTopo.class);
        apt.startConsumeKafka();
        logger.warn("Stream processer started.");
	}
	
}
